<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js对象相关</title>
</head>
<body>
<div id="app"></div>
<script src="../vue.js"></script>
<script>

    var name = "111";//window.name = "111";使用var默认会挂载在window上
    var a ="222";
    let child = 'boy';//使用let声明变量是不会挂载到window上
    var obj = {
        name:'yateng'
    }
    console.log(name);//等同于window。name
    console.dir(window);
    console.log(obj.name);
    obj.age = 18;//往obj这个对象上添加一个叫age的属性
    obj['age'] = 18;//往obj这个对象上添加一个叫age的属性
    console.log(obj);
    delete obj.age;
    console.log(obj);
</script>
</body>
</html>